﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vds2465Telegrams
{
    public class UserData_11_Error_UserDataTypeUnknown : UserData_Device
    {
        #region private member variables

        private readonly byte _unknownUserDataType;
		
		#endregion private member variables

		#region constructor

        public UserData_11_Error_UserDataTypeUnknown(byte device, byte unknownUserDataType)
            : base(UserData.UserData11Error, device)
		{
            _unknownUserDataType = unknownUserDataType;
		}

		#endregion constructor

		#region getters

		public byte UnknownUserDataType { get { return _unknownUserDataType; } }

		#endregion getters
		
		#region ToString, Equals, GetHashCode

		public override int GetHashCode()
        {
            int hashCode = base.GetHashCode();
            hashCode ^= _unknownUserDataType;

            return hashCode;
        }

        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append("(");
            stringBuilder.Append(ToStringProperties());
            stringBuilder.Append(")");

            return stringBuilder.ToString();
        }

        internal override string ToStringProperties()
        {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append(base.ToStringProperties());
            stringBuilder.Append(", ");

            stringBuilder.Append("UnknownUserDataType='");
            stringBuilder.Append(UnknownUserDataType);
            stringBuilder.Append("'");
            return stringBuilder.ToString();
        }

        public override bool Equals(object obj)
        {
            Type objType = obj.GetType();
            if (this.GetType() == objType)
            {
                UserData_11_Error_UserDataTypeUnknown userData2Compare = obj as UserData_11_Error_UserDataTypeUnknown;
                return EqualsProperties(userData2Compare);
            }

            return false;
        }

        internal bool EqualsProperties(UserData_11_Error_UserDataTypeUnknown userData2Compare)
        {
            if (base.EqualsProperties(userData2Compare))
            {
                return (UnknownUserDataType == userData2Compare.UnknownUserDataType);
            }

            return false;
        }

        #endregion ToString, Equals, GetHashCode
    }
}
